import request from '@/utils/request';
import { other } from './prefix';

const goodManage = {
  // 查询展厅列表
  getStadiums(params) {
    return request.get(other + '/jp_stadiums', { params });
  },
  // 创建展厅
  setStadiums(params) {
    return request.post(other + '/jp_stadiums', params);
  },
  // 更新展厅信息
  updStadiums(id, params) {
    return request.post(other + '/jp_stadiums/' + id, params)
  },
  // 删除展厅
  delStadiums(id) {
    return request.delete(other + '/jp_stadiums/' + id)
  },
  // 查询展厅作品列表
  getWorkList(params) {
    return request.get(other + '/jp_stadiums_image', { params });
  },
  // 新增作品
  addWork(params) {
    return request.post(other + '/jp_stadiums_image', params);
  },
  // 删除作品
  delWork(params) {
    return request.delete(other + '/jp_stadiums_image/' + params.id)
  },
  // 更新作品信息
  updWork(id, params) {
    return request.post(other + '/jp_stadiums_image/' + id, params)
  },
  // 上传视频
  uploadVideo(id, params) {
    return request.post(other + '/jp_stadiums_image/' + id + '?op=upload_file&name=video_url', params);
  },
  // 上传展厅封面
  uploadImage(id, params) {
    return request.post(other + '/jp_stadiums/' + id + '?op=upload_file&name=title_page', params)
  },
  // 上传作品封面
  uploadWorkImage(id, params) {
    return request.post(other + '/jp_stadiums_image/' + id + '?op=upload_file&name=title_page', params)
  },
  // 删除3dmodle
  del3dmodle(id) {
    return request.delete(other + '/3dmodle/' + id);
  },
  // 上传3dmodle图片
  set3dmodleImage(id, params) {
    return request.post(other + '/3dmodle/' + id + '?op=upload_file&name=title_page', params);
  },
  // 上传模型和下载模型
  setUpload3dModel(id, params) {
    return request.post(other + '/upload_data?op=upload_3d_model&stadium_id=' + id, params);
  },
};

export default goodManage;
